<?php
	include 'session.inc';
	include 'createFileName.inc';
	check_login();
	
	function getPosts($uid) {
		chdir('posts');
		$posts = glob($uid . '_*.html');
		foreach($posts as $value) {
			print '<a href="posts/' . $value . '">' . $value . '<hr>';
		}
		//print_r();
	}
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>Skriv til blogg</title>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
  </head>
  <body bgcolor="#EEEEEE">
  <p><a href="blog.html">Ny post</a>
  </p>
  <h1>Mine poster</h1>
  <?php
	getPosts($_SESSION['uid']);
  ?>
  </body>
</html>